package extract.knowledge.concept;

import com.thinkaurelius.titan.core.TitanGraph;
import extract.knowledge.general.BaseFactory;

import javax.inject.Inject;

import common.model.graph.ConceptSchema;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
import common.dao.gremlin.TitanGraphDao;

/**
 * Created by Common on 7/31/16.
 */
@Component
public class ConceptFactory extends BaseFactory{
    private  final Logger logger = LoggerFactory.getLogger(ConceptFactory.class);

    @Inject
    public ConceptFactory(TitanGraph graph){
        super(graph);

        this.label_value = ConceptSchema.Properties.has_label_value;
        this.node_type_value = ConceptSchema.Properties.has_node_type_value;
    }





    /**********************
     *
     * @param args
     */
    public static void main(String[] args){

        TitanGraphDao tgdao = new TitanGraphDao("debug");
        TitanGraph graph = tgdao.getTitanGraph();

        ConceptFactory factory = new ConceptFactory(graph);

        /*
        factory.getAllConcepts();

        Integer id = 987654332;
        Vertex concept = factory.getOrCreateConcept(id);
        System.out.println(concept.id() + " " + factory.getID(concept) + " " + concept.label());

        factory.getAllConcepts();

        factory.delConceptsByID(id);
        */

        factory.getAllVertexes();

        //factory.delAllConcepts();


    }

}
